home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Python-1.4 / Lib / symbol.py < prev    next >
Text File  |  1998-06-24  |  2KB  |  94 lines

  1. #! /usr/bin/env python
  2. #
  3. #  Non-terminal symbols of Python grammar (from "graminit.h")
  4. #
  5. #  This file is automatically generated; please don't muck it up!
  6. #
  7. #  To update the symbols in this file, 'cd' to the top directory of
  8. #  the python source tree after building the interpreter and run:
  9. #
  10. #    PYTHONPATH=Lib:Modules ./python Lib/symbol.py
  11. #
  12. #  (this path allows the import of string.py, token.py, and regexmodule.so
  13. #  for a site with no installation in place)
  14.  
  15. #--start constants--
  16. single_input = 256
  17. file_input = 257
  18. eval_input = 258
  19. funcdef = 259
  20. parameters = 260
  21. varargslist = 261
  22. fpdef = 262
  23. fplist = 263
  24. stmt = 264
  25. simple_stmt = 265
  26. small_stmt = 266
  27. expr_stmt = 267
  28. print_stmt = 268
  29. del_stmt = 269
  30. pass_stmt = 270
  31. flow_stmt = 271
  32. break_stmt = 272
  33. continue_stmt = 273
  34. return_stmt = 274
  35. raise_stmt = 275
  36. import_stmt = 276
  37. dotted_name = 277
  38. global_stmt = 278
  39. exec_stmt = 279
  40. compound_stmt = 280
  41. if_stmt = 281
  42. while_stmt = 282
  43. for_stmt = 283
  44. try_stmt = 284
  45. except_clause = 285
  46. suite = 286
  47. test = 287
  48. and_test = 288
  49. not_test = 289
  50. comparison = 290
  51. comp_op = 291
  52. expr = 292
  53. xor_expr = 293
  54. and_expr = 294
  55. shift_expr = 295
  56. arith_expr = 296
  57. term = 297
  58. factor = 298
  59. power = 299
  60. atom = 300
  61. lambdef = 301
  62. trailer = 302
  63. subscriptlist = 303
  64. subscript = 304
  65. sliceop = 305
  66. exprlist = 306
  67. testlist = 307
  68. dictmaker = 308
  69. classdef = 309
  70. arglist = 310
  71. argument = 311
  72. #--end constants--
  73.  
  74. names = dir()
  75. sym_name = {}
  76. for name in names:
  77.     number = eval(name)
  78.     if type(number) is type(0):
  79.     sym_name[number] = name
  80.  
  81.  
  82. def main():
  83.     import sys
  84.     import token
  85.     if len(sys.argv) == 1:
  86.     sys.argv = sys.argv + ["Include/graminit.h", "Lib/symbol.py"]
  87.     token.main()
  88.  
  89. if __name__ == "__main__":
  90.     main()
  91.  
  92. #
  93. #  end of file
  94.